<template>
  <div id="app" @click="hiddenShow">
    <my-title
      :myTitle="myTitle"
      :isshow="isshow"
      @changeShow="changeShow"
    ></my-title>
    <content-box>
      <router-view />
      <ul class="nav">
        <router-link to="/home" tag="li" active-class="on">首页</router-link>
        <router-link to="/good" tag="li" active-class="on">商品</router-link>
        <router-link to="/mine" tag="li" active-class="on">我的</router-link>
      </ul>
    </content-box>
  </div>
</template>
<script>
import myTitle from "./components/Title.vue";
import contentBox from "./components/Content.vue";
export default {
  components: { contentBox, myTitle },
  data() {
    return {
      myTitle: "猫眼电影",
      isshow: false,
    };
  },
  methods: {
    changeShow() {
      this.isshow = !this.isshow;
    },
    hiddenShow() {
      if (this.isshow) {
        this.isshow = false;
      }
    },
  },
};
</script>
<style lang="scss">
* {
  padding: 0;
  margin: 0;
}
html,
body {
  height: 100%;
}
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
  .nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 40px;
    position: fixed;
    bottom: 0;
    border-top: 2px solid #ccc;
    overflow: hidden;
    li {
      list-style: none;
      padding: 20px;
    }
    .on {
      color: blue;
    }
  }
}
</style>
